package com.yonyou.isv.demo.openapi.api.org;

import com.yonyou.isv.demo.openapi.api.*;
import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataArrayResponse;
import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataResponse;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @description: 组织单元接口
 * @author: nishch
 * @create: 2021-07-05
 **/
@Component
public class OrgUnitApi extends BaseOpenApi{

    public Map<String, Object> save(Map<String, Object> params) {
        ApiDataResponse apiDataResponse =  postForEntity(OpenApiURL.ORG_SAVE,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }

    public Map<String, Object> detail(Map<String, String> params) {
        ApiDataResponse apiDataResponse =  getForEntity(OpenApiURL.ORG_DETAIL,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }

    public List<Map<String, Object>> list(Map<String, Object> params) {
        ApiDataArrayResponse apiDataResponse =  postForEntity(OpenApiURL.ORG_QUERY_TREE,params, ApiDataArrayResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> unstop(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.ORG_UNSTOP, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> stop(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.ORG_STOP, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> qrydelegate(Map<String,String> params)
    {
        ApiDataResponse apiDataResponse = getForEntity(OpenApiURL.ORG_QRYDELEGATE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> saledelegate(Map<String,String> params)
    {
        ApiDataResponse apiDataResponse = getForEntity(OpenApiURL.ORG_SALEDELEGATE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> sync(Map<String,String> params)
    {
        ApiDataResponse apiDataResponse = getForEntity(OpenApiURL.ORG_SYNC, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> doSync(Map<String,String> params)
    {
        ApiDataResponse apiDataResponse = getForEntity(OpenApiURL.ORG_DOSYNC, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> qryDefault(Map<String,String> params)
    {
        ApiDataResponse apiDataResponse = getForEntity(OpenApiURL.ORG_QRYDEFAULT, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> findByOrgid(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.ORG_FIND_BY_ORGID, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }



}
